import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class StudentCountVisitor implements Visitor {
    private int studentCount = 0;
    private Set<Student> visitedStudents = new HashSet<>();

    @Override
    public void visit(PaperSelection selection) {
        Map<Paper, Student> selections = selection.getSelections();
        for (Student student : selections.values()) {
            if (!visitedStudents.contains(student)) {
                visitedStudents.add(student);
                studentCount++;
            }
        }
    }

    public int getStudentCount() {
        return studentCount;
    }
}    